﻿@model SailHero.Soft.FrameWork.Models.SYS_ROLE
@{
    ViewBag.Title = "成员设置";
    Layout = "../Shared/_Layout.cshtml";
}
 <script type="text/javascript">

     $(function () {
         $("#save").click(function () {
             var roleID = $("#RoleID").val();
             var userID = "";
             $("input:checked").each(function (i) {
                 userID += $(this).val() + ";";
             });
             //alert(roleID + "--" + userID);

             var msg = "";
             if (userID == "") {
                 msg = "确定该角色下不用选择任何一个人？";
             }
             else {
                 msg = "确定要保存？";
             }
             $.messager.confirm("提示信息", msg, function (r) {
                 if (r) {
                     var url = "/Role/UserSet2";
                     $.post(url, {
                         roleID: roleID
                         , userID: userID
                     },
                        function (data) {
                            if (data == "success") {
                                window.location.href = "/Role/Index";
                            }
                            else {
                                $.messager.alert("错误信息", data, "error");
                            }
                        });
                 }
                 else {

                 }
             });
         });
     });
    </script>

<div id="main_zone">
    <table width="99%" style="text-align: left;" border="0" align="center" cellpadding="3"
        cellspacing="1">
        <tr>
            <td width="18%" class="left_title_1">
                角色名称
            </td>
            <td width="82%" style="text-align: center;">
                @Model.ROLENAME
                @Html.HiddenFor(model => model.ROLEID)
            </td>
        </tr>
        <tr>
            <td class="left_title_2">
            </td>
            <td>
                <div id="divChk">
                    @ViewBag.Helper.CheckBoxList("userList", ViewData["userList"] as SelectList)
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="2" class="left_title_2" style="text-align: center;">
                <a id="save" class="easyui-linkbutton">保存</a>&nbsp;&nbsp;&nbsp;&nbsp; 
                <a href="/Role/Index" class="easyui-linkbutton">取消</a>
            </td>
        </tr>
    </table>
</div>
